#include <dos.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <conio.h> 
int pwd[9],iport=0x70,dport=0x71,i,j,n,temp,k,L,H,four,yaxis=0; 
unsigned int x; 
unsigned long y,z;

void main()
{ 
outportb(iport,28); 
L=inportb(dport); 
outportb(iport,29); 
H=inportb(dport); 
x=256*H+L; 
clrscr(); 
textcolor(LIGHTBLUE); 
gotoxy(21,2); 
cprintf(" BIOS Password Viewer Ver1.0"); 
gotoxy(21,3); 
textcolor(GREEN); 
gotoxy(17,16); 
cprintf("This is a freeware,and it's written by "); 
textcolor(BLINK+RED); 
cprintf("Z.H.W"); 
for(i=0,j=0,n=0;i<42&&yaxis<10;i++,j=0,n=0) 
{ 
y=x+65535*i; 
do{ 
for(temp=0,four=4;temp<n;temp++)four*=4; 
z=3*y/(four-1); 
if(z<=126) 
{ 
if(z<32)break; 
else 
{ 
pwd[j]=z;j++;y-=z*four/4; 
if(y==0) 
{ 
textcolor(WHITE); 
gotoxy(25,4+yaxis); 
cprintf("Your BIOS password is: "); 
textcolor(LIGHTRED); for(k=0;k<j+1;k++) 
for(k=0;k<j;k++) 
cprintf("%c",pwd[k]); 
yaxis++; 
} 

n--; 
} 
} 
else n++; 
}while(n<8); 
} 
gotoxy(1,18); 
textcolor(BROWN); 
cprintf("Thank you for using this software.\r\nIf you like it,please send me a letter,\r\nI think"); 
cprintf(",I will be very happy."); 
printf("\n"); 
textcolor(10); 
cprintf("Corp:");textcolor(13); 
cprintf(" College Of Communication Engineering Informatics XTU.EDU.CN");textcolor(10); 
cprintf("\r\nE_Mail:"); textcolor(13); 
cprintf(" xiaomazhw2001@sina.com");textcolor(10); 
printf("\n"); 
cprintf("Address:"); textcolor(13); 
cprintf(" N6-311");textcolor(10); 
printf("\n"); 
cprintf("Tel:");textcolor(13); 
cprintf(" 0732--2356275"); 
printf("\n"); 
getch(); 
exit(0); 
}